package com.ycode.bang.anbang.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.ycode.bang.anbang.R;
import com.ycode.bang.anbang.baseui.BaseActivity;
import com.ycode.bang.anbang.utils.ToastUtil;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class DealAgain extends BaseActivity implements View.OnClickListener {
    @InjectView(R.id.edit_all)
    EditText mEdit;
    @InjectView(R.id.btn_againdeal)
    Button mBtnAd;
    @InjectView(R.id.title)
    TextView title;
    public int orderId;

    private int tag=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_deal_again);
        ButterKnife.inject(this);
        if (this.getIntent().getExtras() != null) {
            Bundle bundle = this.getIntent().getExtras();
            orderId = bundle.getInt("orderId");
            tag=bundle.getInt("tag");
        }
        initView();
    }

    public void initView() {
        title.setText("再次处理");
        mBtnAd.setOnClickListener(this);
    }

    @Override
    protected void getSuccessRequest(Object response, int flag) {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_againdeal:
                if (TextUtils.isEmpty(mEdit.getText().toString().trim())) {
                    ToastUtil.show(this, "请填写再次处理原因！");
                    break;
                }
                Intent intent = new Intent(this, SelectPeopleActivity.class);
                bundle.putInt("orderId", orderId);
                bundle.putString("contect", mEdit.getText().toString().trim());
                if (tag==3){//投诉
                    bundle.putInt("tag", 99);
                }else{
                    bundle.putInt("tag", 1);//public
                }
                intent.putExtras(bundle);
                startActivity(intent);
                finish();
                break;
        }
    }
}
